package base.day26.tcp;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class ReceptionDemo1 {
    public static void main(String[] args) throws IOException {
        //创建服务器socket对象
        ServerSocket ss=new ServerSocket(10005);
        //等待客户端连接
        Socket accept = ss.accept();
        //获取输入流对象
        InputStream is = accept.getInputStream();
        int b;
        while ((b=is.read())!=-1){
            System.out.print((char)b);
        }
        ss.close();


    }
}
